package xyz.hujf.base.threadLocal;

/**
 * @author Hujf
 * @title: TT
 * @date 2021-04-239:55
 * @description: TODO
 */
public class TT implements Runnable{

    static ThreadLocal<String> local = new ThreadLocal<String>();
    @Override
    public void run() {
        local.set("线程 "+Thread.currentThread().getName());
        print("线程 "+Thread.currentThread().getName());
        System.out.println(local.get());
    }

    static void print(String str){
        System.out.println(Thread.currentThread().getName()+ str +" :"+local.get());
        local.remove();
    }

}
